package cn.sfa.common.jms;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;
/**
 * 
* 类名称：TestServlet   
* 类描述：  测试类
* 创建人：lenovo   
* 创建时间：2012-2-9 下午6:08:32     
* 修改备注：   
* @version
 */
public class TestServlet extends HttpServlet {
	private static Logger log = LoggerFactory.getLogger(TestServlet.class);

	public void service(HttpServletRequest request, HttpServletResponse response)
			throws IOException, ServletException {
		ApplicationContext context = WebApplicationContextUtils
				.getWebApplicationContext(this.getServletContext());
		ResourceMessageProducer resourceMessageProducer = resourceMessageProducer = (ResourceMessageProducer) context
				.getBean("resourceMessageProducer");
		Book book = new Book();
		book.setId(123);
		book.setName("重构");
		book.setAuthor("Martin Fowler");
		resourceMessageProducer.send(book);
		// request.getRequestDispatcher(forwardPath).forward(request, response);
	}
}
